<?php
/*
 *    Prototyp-Ro
 *    Copyright (C) 2011  Patton
 *
 *    This program is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    This program is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
Class User_Box extends User_Connection{
    function Login_Show(){
        if(isset($_POST['username']) && isset($_POST['psswd'])){
            User_Connection::log_in($_POST['username'], $_POST['psswd']);
        }
        if(isset($_SESSION['log_in'])){
             echo $_SESSION['username'];
        }
        else{
            echo  "      <form action=\"\" method=\"post\">\n"
                    ."          <table style=\"\">\n"
                    ."              <tbody>\n"
                    ."                  <tr>\n"
                    ."                      <td>". _CL_USERNAME ." :</td>\n"
                    ."                      <td><input name=\"username\" size=\"10\" maxlength=\"23\" type=\"text\"></td>\n"
                    ."                  </tr>\n"
                    ."                  <tr>\n"
                    ."                      <td>". _CL_PASSWORD ." :</td>\n"
                    ."                      <td><input name=\"psswd\" size=\"10\" maxlength=\"23\" type=\"password\"></td>\n"
                    ."                  </tr>\n"
                    ."                  <tr>\n"
                    ."                      <td colspan=\"2\" align=\"center\"><input value=\"login\" type=\"submit\"></td>\n"
                    ."                  </tr>\n"
                    ."              </tbody>\n"
                    ."          </table>\n"
                    ."      </form>\n";
        }
        return;
    }
}
$User_Box = new User_Box();
?>